package com.zhuangxiaoyan.spring.srcode.entity;

import java.util.Objects;

/**
 * @Classname User2
 * @Description TODO
 * @Date 2022/5/4 11:15
 * @Created by xjl
 */
public class User2 {
    private static final long serialVersionUID = -8054600833969507380L;

    private Integer id;

    private String username;

    private Integer age;

    public User2() {
    }

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public String getUsername() {
        return username;
    }

    public void setUsername(String username) {
        this.username = username;
    }

    public Integer getAge() {
        return age;
    }

    public void setAge(Integer age) {
        this.age = age;
    }

    @Override
    public String toString() {
        return "User{" +
                "id=" + id +
                ", username='" + username + '\'' +
                ", age=" + age +
                '}';
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) {
            return true;
        }
        if (o == null || getClass() != o.getClass()) {
            return false;
        }
        User2 user2 = (User2) o;
        return Objects.equals(id, user2.id) &&
                Objects.equals(username, user2.username) &&
                Objects.equals(age, user2.age);
    }

    @Override
    public int hashCode() {
        return Objects.hash(id, username, age);
    }
}
